
/*无邮箱验证码*/
function factory (UserModel) {
  return function (req, res) {
    var body = req.body;
    UserModel.findOne({user: body.user}, function (err, user) {
      if (!user) {
        var user =new UserModel({
          user: body.user,
          password: body.password,
          email: body.email,
          sex: body.sex
        })
        user.save(function (err, user) {
          res.send('1')
        })
      }else {
        res.send('0')
      }
    })
  }
}

module.exports = factory
